package com.wty.cmims.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wty.cmims.pojo.Code;
import com.wty.cmims.pojo.Department;
import com.wty.cmims.pojo.ResponseResult;
import com.wty.cmims.service.DepartmentService;
import com.wty.cmims.mapper.DepartmentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
* @author wty
* @description 针对表【department】的数据库操作Service实现
* @createDate 2024-11-20 22:07:34
*/
@Service
public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Department>
    implements DepartmentService{
    @Autowired
    private DepartmentMapper departmentMapper;
    @Override
    public ResponseResult<Map<String, Object>> departmentFind(Map<String, Object> paramsMap) {
        ResponseResult<Map<String, Object>> responseResult = new ResponseResult<>();
        List<Map<String, Object>> departments = departmentMapper.findDepartment(paramsMap);
        if (departments != null) {
            responseResult.setCode(Code.SUCCESS);
            responseResult.setMessage("查询科室信息成功");
            responseResult.setDatas(departments);
        } else {
            responseResult.setCode(Code.ERROR);
            responseResult.setMessage("查询医疗机构信息失败");
        }
        return responseResult;
    }
}




